import {createApp, createVNode} from 'vue'
import ElementPlus from 'element-plus'
import {createPinia} from 'pinia'
import App from './App.vue'
import 'element-plus/dist/index.css'
import '../src/assets/css/common.less'
import router from './router'
import * as Icons from '@element-plus/icons-vue'

const app = createApp(App)
app.use(ElementPlus, {size: 'mini', zIndex: 3000})
    .use(createPinia())
    .use(router)

// 创建Icon组件
const Icon = (props: { icon: string }) => {
    const {icon} = props
    return createVNode(Icons[icon as keyof typeof Icons])
}
// 注册Icon组件
app.component('Icon', Icon)
app.mount('#app')
